package com.zx.config.filter;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigurerAdapter implements WebMvcConfigurer {

    /**
     * 配置静态访问资源
     *
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/bui/**").addResourceLocations("classpath:/static/bui/");
        registry.addResourceHandler("/Css/**").addResourceLocations("classpath:/static/Css/");
        registry.addResourceHandler("/dataTable/**").addResourceLocations("classpath:/static/dataTable/");
        registry.addResourceHandler("/images/**").addResourceLocations("classpath:/static/images/");
        registry.addResourceHandler("/highcharts/**").addResourceLocations("classpath:/static/highcharts/");
        registry.addResourceHandler("/imge/**").addResourceLocations("classpath:/static/imge/");
        registry.addResourceHandler("/jquery-easyui-1.4.5/**")
                .addResourceLocations("classpath:/static/jquery-easyui-1.4.5/");
        registry.addResourceHandler("/My97DatePicker/**").addResourceLocations("classpath:/static/My97DatePicker/");
        registry.addResourceHandler("/layui-v2.4.5/**").addResourceLocations("classpath:/static/layui-v2.4.5/");
        registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/assets/");
        registry.addResourceHandler("/js/**").addResourceLocations("classpath:/static/js/");
        registry.addResourceHandler("/echarts-5.4.2/**").addResourceLocations("classpath:/static/echarts-5.4.2/");
        registry.addResourceHandler("/2.ico").addResourceLocations("classpath:/static/2.ico");
        registry.addResourceHandler("/**").addResourceLocations("classpath:/templates/");
        WebMvcConfigurer.super.addResourceHandlers(registry);
    }
}
